package com.yuelan.app.controller;

import com.yuelan.app.domain.RentPayOrder;
import com.yuelan.app.service.OrderService;
import com.yuelan.common.annotation.Log;
import com.yuelan.common.core.controller.BaseController;
import com.yuelan.common.enums.BusinessType;
import com.yuelan.common.exception.GlobalException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @description:
 * @Author: ZhaoYi
 * @date: 24-7-11 21:49
 */

@RestController
@RequestMapping("/pay")
public class OrderController extends BaseController {

    private static final Logger logger = LoggerFactory.getLogger(GlobalException.class);

    @Resource
    private OrderService orderService;


    @PostMapping("/rent")
    @Log(title = "支付租金订单", businessType = BusinessType.INSERT)
    public void rentOrder(@RequestBody RentPayOrder rentPayOrder) {
        logger.info(rentPayOrder.toString());
        orderService.createRentPayOrder(rentPayOrder);
    }

}
